#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py
# Date    : 2021-01-13
# Author  : Tom.Lee


# 基础题
name = input("请输入你的名字")
print("你好，%s" % name)


#挑战题
#计算组不重复数字个数的函数
def fcount(n:int):
    if n <= 1: return 1
    return n * fcount(n -1 )

def avg(arry):
    return sum(arry)/len(arry)


num_tup = (1, 2, 3, 4)
newNums = []
for x in num_tup:
    for y in num_tup:
        for z in num_tup:
            if (x != y) and (y != z) and (z != x):
                newNums.append(x*100+y*10+z)

# def getDiffArray(level, arry):
#     newNums = []
#     tempArray = []
#     for i in range(level):
#         tempArray = []
#         tempArray.append(arry[i])
#         for num in arry:
#             if num not in tempArray:
#                 tempArray.append(num)



print("总共能组成{}个数字".format(len(newNums)))
print("平均值为：{}".format(avg(newNums)))
